package java_zuoye_2;

import java.util.Arrays;
import java.util.Random;

public class homework_4 {
	public static void main(String[] arg) {
		int[][] arr = {{1,2},{3,4,5,6},{7,8,9,10}};
		changeArr(arr);
		for (int[] row : arr) {
            System.out.println(Arrays.toString(row));
        }
	}
	
	public static void changeArr(int[][] arr) {
		 Random random = new Random();
	        for (int i = arr.length - 1; i > 0; i--) {
	            for (int j = arr[i].length - 1; j > 0; j--) {
	                int m = random.nextInt(i + 1);
	                int n = random.nextInt(j + 1);
	                int temp = arr[i][j];
	                arr[i][j] = arr[m][n];
	                arr[m][n] = temp;
	            }
	        }
	    }
	}

